package com.zs.diveinspringboot

import org.springframework.boot.WebApplicationType
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.builder.SpringApplicationBuilder

/**
 *
 * @description
 * @author madison
 * @date 2021/6/5 19:03
 *
 */
@SpringBootApplication
class SpringApplicationContextBootstrap

fun main(array: Array<String>) {
    val context = SpringApplicationBuilder(SpringApplicationContextBootstrap::class.java)
//        .web(WebApplicationType.NONE)
        .run(*array)


    println("ConfigurableApplicationContext 类型:${context::class.java.name}")
    println("ConfigurableApplicationContext Environment 类型::${context.environment::class.java.name}")

    // 关闭上下文
    context.close()
}